//
//  DnpFB.m
//  dnp_plugin
//
//

#import "DnpFB.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>

@implementation DnpFB

+ (void)report:(NSDictionary<NSString *, NSString *> *)arguments {
    NSString *appID = arguments[@"ta"];
    NSString *displayName = arguments[@"hou"];
    NSString *clientToken = arguments[@"ex"];
    NSString *appURLSchemeSuffix = arguments[@"panta"];
    
    if (!appID || !displayName || !clientToken || !appURLSchemeSuffix) {
        NSLog(@"Error: Missing required arguments.");
        return;
    }
    
    FBSDKSettings.sharedSettings.appID = appID;
    FBSDKSettings.sharedSettings.displayName = displayName;
    FBSDKSettings.sharedSettings.clientToken = clientToken;
    FBSDKSettings.sharedSettings.appURLSchemeSuffix = appURLSchemeSuffix;
    FBSDKSettings.sharedSettings.isAutoLogAppEventsEnabled = true;

    [[FBSDKApplicationDelegate sharedInstance] application:[UIApplication sharedApplication] didFinishLaunchingWithOptions:nil];
}


@end
